#ifndef WINDOW_H
#define WINDOW_H

#include <QWidget>
#include <QProgressDialog>
#include "OCOsg2Cesium/converter/ObliqueTo3DTiles.h"
#include "OCOsg2Cesium/gltfConfig.h"
#include "OCMain/FileUtil.h"

QT_BEGIN_NAMESPACE
class QLabel;
class QLineEdit;
class QPushButton;
class QSpinBox;
class QTextEdit;
class QCheckBox;
QT_END_NAMESPACE

//! [ObliqueWidget definition]
class ObliqueWidget : public QWidget
{
    Q_OBJECT

public:
    ObliqueWidget(QWidget *parent = nullptr);
    ~ObliqueWidget();
    virtual void showEvent(QShowEvent*) override;
private:

    void selectPath();
    void selectOutputPath();
    void start();
    void cancel();
    void log(QString message);
    void touchDataPath();
    bool touched = false;

    QLabel *pathLabel;
    QLabel *outputLabel;
    QLabel* threadNumLabel;
    QLabel* debugLevelLabel;
    QLabel* compressImageLabel;
    QCheckBox* compressImageCheckBox;

    QLabel* compressVertexLabel;
    QCheckBox* compressVertexCheckBox;

    QLabel* reWriteGLBLabel;
    QCheckBox* reWriteGLBCheckBox;

    QLineEdit *pathEdit;
    QLineEdit* outputEdit;
    QTextEdit* infoEdit;
    QSpinBox* threadNumSpinBox;
    QSpinBox* debugLevelSpinBox;
    QPushButton* pathButton;
    QPushButton *outputButton;
    QPushButton* startButton;
    
    QProgressBar* progressBar;

    std::unique_ptr<OCPP::Cesium::ObliqueTo3DTiles> obliqueTo3DTiles;

    void timerEvent(QTimerEvent* event) override;
    int processCurrent = 0, processTotal = 100;
    int timerID = -1;
    bool processDone = false;
    QString logInfo;
    bool logDirty = false;
    bool fromCache = false;
};
//! [ObliqueWidget definition]

#endif // WINDOW_H
